package com.xishu.entity.shop;

import com.xishu.annotation.dao.*;
import com.xishu.annotation.lang.Lang;
import com.xishu.entity.ShopItem;
import com.xishu.entity.oplog.OpName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Transient;

@Entity(name = "shop")
@Data
public class Shop extends ShopItem implements OpName {
    private static final long serialVersionUID = 4068549064613975458L;

    @Transient
    private String opName;

    @ApiModelProperty(value = "分店名称")
    @Search(like = true)
    @Lang(key = "name")
    private String name;

    @ApiModelProperty(name = "名称-中文")
    @Lang(key = "name")
    private String name_zh;

    @ApiModelProperty(name = "名称-英文")
    @Lang(key = "name")
    private String name_en;

    @ApiModelProperty(value = "总店餐厅的ID")
    private Long companyId;

    @ApiModelProperty(value = "分店餐厅的ID")
    @NotModify
    private Long shopId;

    @ApiModelProperty(value = "商家的名称")
    @Search(like = true)
    @Lang(key = "companyName")
    private String companyName;

    @ApiModelProperty(value = "商家的名称")
    @Search(like = true)
    @Lang(key = "companyName")
    private String companyName_zh;

    @ApiModelProperty(value = "商家的名称")
    @Search(like = true)
    @Lang(key = "companyName")
    private String companyName_en;

    @Transient
    @FieldMapping(desField = "configJson", serialize = true, isObject = true)
    @Column(length = 1024)
    private ShopConfig shopConfig;

    @FieldMapping(desField = "shopConfig", serialize = false, genericType = "com.xishu.entity.shop.ShopConfig", isObject = true)
    @Column(length = 2048)
    private String configJson;

    @ApiModelProperty(name = "邮件地址")
    private String email;

    @ApiModelProperty(name = "分店地址")
    @Lang(key = "shopAddress")
    private String shopAddress;

    @ApiModelProperty(name = "分店地址")
    @Lang(key = "shopAddress")
    private String shopAddress_zh;

    @ApiModelProperty(name = "分店地址")
    @Lang(key = "shopAddress")
    private String shopAddress_en;

    @ApiModelProperty(name = "分店地址--前端显示")
    private String showAddressShow_zh;

    @ApiModelProperty(name = "分店地址--前端显示")
    private String showAddressShow_en;

    @ApiModelProperty(name = "分店详细地址")
    @Lang(key = "shopDetailAddress")
    private String shopDetailAddress;

    @ApiModelProperty(name = "分店详细地址")
    @Lang(key = "shopDetailAddress")
    private String shopDetailAddress_zh;

    @ApiModelProperty(name = "分店详细地址")
    @Lang(key = "shopDetailAddress")
    private String shopDetailAddress_en;

    @ApiModelProperty(name = "分店描述")
    @Lang(key = "shopDescription")
    private String shopDescription;

    @ApiModelProperty(value = "介绍-中文")
    @Lang(key = "shopDescription")
    private String shopDescription_zh;

    @ApiModelProperty(value = "介绍-英文")
    @Lang(key = "shopDescription")
    private String shopDescription_en;

    @ApiModelProperty(name = "分店的图片")
    private String shopImg;

    @ApiModelProperty(name = "分店的背景图片")
    private String backendImg;

    @ApiModelProperty(value = "营业状态")
    private Boolean businessStatus;

    @ApiModelProperty(value = "服务费的比例,输入整数")
    private Double serviceFeePercent;

    @ApiModelProperty(value = "分店的电话号码")
    private String phone;

    @ApiModelProperty(value = "分店的编码")
    private String code;

    @ApiModelProperty(value = "是否已经打印")
    public Boolean printed;

    @ApiModelProperty(value = "总二维的ID路径")
    private String homeQrFileId;

    @ApiModelProperty(value = "餐桌二维码")
    private String foodTableQrFileId;

    @ApiModelProperty(value = "排队二维码")
    private String lineUpQrFileId;

    @ApiModelProperty(value = "在线触摸屏设备数")
    private Integer onlineTouchDeviceNumber;

    @ApiModelProperty(value = "外卖打折比例,直接输入XX折，比如7.5折")
    private Double takeoutFeePercent;

    @ApiModelProperty(value = "是否强制关闭")
    private Boolean forceClose;

    @ApiModelProperty(value = "qf")
    private Boolean qfComplete;

    @ApiModelProperty(value = "eft 是否配置完成")
    @DefaultValue(defaultValue = "false")
    private Boolean eftComplete;

    @ApiModelProperty(value = "QF是否启动")
    private Boolean qfEnable;

    @ApiModelProperty(value = "QF 的SID")
    private String qfSid;

    @ApiModelProperty(value = "QF 支付的CODE")
    @Encrypt
    private String qfCode;

    @ApiModelProperty(value = "QF 支付的KEY")
    @Encrypt
    private String qfKey;

    @ApiModelProperty(value = "QF 是否要配置C端")
    private Boolean qfConfigCEnd;

    @ApiModelProperty(value = "QF 微信APP ID")
    private String qfWeixinAppId;

    @ApiModelProperty(value = "QF 微信APP ID是否已配置")
    private Boolean qfWeixinAppIdConfig;

    @ApiModelProperty(value = "QF 支付宝APP ID")
    private String qfAlipayAppId;

    @ApiModelProperty(value = "QF 支付宝APP ID是否已配置")
    private Boolean qfAlipayAppIdConfig;

    @ApiModelProperty(value = "stripe已经配置")
    private Boolean stripeComplete;

    @ApiModelProperty(value = "stripe是否启动")
    private Boolean stripeEnable;

    @ApiModelProperty(value = "stripe ak")
    private String stripeAk;

    @ApiModelProperty(value = "stripe sk")
    @Encrypt
    private String stripeSk;

    @ApiModelProperty(value = "stripe web hook sk")
    @Encrypt
    private String stripeWebHookSk;

    @ApiModelProperty(value = "餐桌二维码生成时间")
    private String foodTableQrQc;

    @ApiModelProperty(value = "总二维码生成时间")
    private String totalQrQc;

    @ApiModelProperty(value = "排队二维码生成时间")
    private String lineUpQc;

    @ApiModelProperty(value = "桌面二维码失效时间,先付款场景")
    private Integer qrCodeOnDeskDisablePayFirst;

    @ApiModelProperty(value = "桌面二维码失效时间,后付款场景")
    private Integer qrCodeOnDeskDisablePayAfter;

    @ApiModelProperty(value = "服务员出单二维码失效时间，先付款情况")
    private Integer qrCodeDisableAddNewOrderPayFirst;

    @ApiModelProperty(value = "服务员出单二维码失效时间，后付款情况")
    private Integer qrCodeDisableAddNewOrderPayAfter;

    @NotModify
    @ApiModelProperty(value = "上次扫描时间")
    private Long lastScanTime;

    @ApiModelProperty(value = "营业时间")
    @NotModify
    public Long openTime;

    @ApiModelProperty(value = "闭店时间")
    @NotModify
    public Long closeTime;

    @ApiModelProperty(value = "上一次的经营周期")
    private Integer timeFix;

    @ApiModelProperty(value = "显示语言选择,0表示双语言，1表示中文，2表示英文")
    private Integer langInt;

    @ApiModelProperty(value = "分店的状态，1表示正在闭店，0表示可以正常进行所有状态")
    private Integer status;

    @Transient
    @ApiModelProperty(value = "闭店报告里面的语言, zh:中文，en:英文")
    private String lang;

    @Transient
    private String testEmail;

    @Transient
    private String testContent;

    @ApiModelProperty(value = "美国版本地址")
    private String usAddress;

    @ApiModelProperty(value = "美国版本城市")
    private String usCity;

    @ApiModelProperty(value = "美国版邮编")
    private String usZip;

    @ApiModelProperty(value = "美国版本州")
    private String usState;

    @ApiModelProperty(value = "是否已经初始化过支付类型")
    public Boolean initPayType;

    @Transient
    @FieldMapping(desField = "foodPandaJson", serialize = true, isObject = true)
    @Hidden(enterHidden = true)
    private FoodPandaConfig foodPandaConfig;

    @FieldMapping(desField = "foodPandaConfig", serialize = false, genericType = "com.xishu.entity.shop.FoodPandaConfig", isObject = true)
    @Column(columnDefinition = "MEDIUMTEXT")
    @Hidden
    private String foodPandaJson;

    @ApiModelProperty(value = "纬度")
    private Double latitude;

    @ApiModelProperty(value = "经度")
    private Double longitude;

    public Shop() {
    }

    @Override
    public String getOpName() {
        return opName;
    }

    @Override
    public void setOpName(String opName) {
        this.opName = opName;
    }

    @Override
    public String opType() {
        return "餐厅分店";
    }

    @Override
    public String[] fieldName() {
        return new String[]{"name"};
    }

}
